package com.shopping.serviceImpl;

import com.shopping.dao.AddressDao;
import com.shopping.pojo.Address;
import com.shopping.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AddressServiceImpl implements AddressService {
    @Autowired
    private AddressDao addressDao;

    @Override
    public boolean insertAddress(Address address) {
        return addressDao.insertAddress(address)>0;
    }

    @Override
    public boolean updateAddress(Address address) {
        return addressDao.updateAddress(address)>0;
    }

    @Override
    public boolean deleteAddress(Integer id) {
        return addressDao.deleteAddress(id)>0;
    }

    @Override
    public List<Address> selectAddressByUserId(Integer userId) {
        return addressDao.selectAddressByUserId(userId);
    }
}
